package cn.zl.ssoserver.login.service.impl;

import cn.zl.ssoserver.login.service.LoginService;
import cn.zl.ssoserver.util.EncryptUtil;
import org.springframework.stereotype.Service;
import org.springframework.util.DigestUtils;

/**
 * @Description:
 * @Author: zllwsy
 * @Date: 2020/11/4 11:10
 */
@Service
public class LoginServiceImpl implements LoginService {
    @Override
    public String getTicket(String userName) {
        return "获取到ticket";
    }

    @Override
    public String createTicket(String uuid) {
        return DigestUtils.md5DigestAsHex((EncryptUtil.SALT+uuid+System.currentTimeMillis()).getBytes());
    }

    @Override
    public boolean login(String userName, String password) {
        return userName.equalsIgnoreCase(password);//用户名等于密码即可登录
    }

    @Override
    public boolean logout(String userName) {
        return false;
    }
}
